package com.xxy.mybatispluspro.handler;

import com.xxy.mybatispluspro.utils.JsonData;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import javax.servlet.http.HttpServletRequest;

@RestControllerAdvice
public class CustomExtHandler {

    @ExceptionHandler(value = Exception.class)
    JsonData HandlerException(Exception e, HttpServletRequest request){
        System.out.println(e);
        return JsonData.buildError("服务器出现问题了!");
    }
}
